package com.lsq.controller;

import com.lsq.common.AjaxResult;
import com.lsq.common.RequestMapping;
import com.lsq.entity.Auction;
import com.lsq.service.AuctionService;
import com.lsq.service.impl.AuctionServiceImpl;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * @version 1.0
 * @author:罗苏琴
 * @Date 2024/12/16 上午11:53
 */
@RequestMapping("/auction")
public class AuctionServlet {
    AuctionService auctionService=new AuctionServiceImpl();
    @RequestMapping("/pageList")
    public AjaxResult getList(HttpServletRequest request, HttpServletResponse response){
        AjaxResult ajaxResult=new AjaxResult();
        String name= request.getParameter("");
        String pageIndexStr= request.getParameter("pageIndex");
        String pageSizeStr= request.getParameter("pageSize");
        Integer pageBegin=pageIndexStr !=null? Integer.parseInt(pageIndexStr):0;
        Integer pageSize=pageSizeStr !=null? Integer.parseInt(pageSizeStr):2;
        Auction auction=new Auction();
        auction.setAuctionName(name);
       List<Auction> auctionList= auctionService.getPageList(auction,pageBegin,pageSize);
       int total=auctionService.getCount(auction);
        return ajaxResult;
    }
}
